package com.ymm.lulutong.domain;

import com.ymm.lulutong.utils.Result;
import com.ymm.system.api.dto.ShipperOrderBriefResponse;
import com.ymm.system.api.dto.ShipperOrderDetailResponse;

import java.util.List;

/**
 * @author guorui
 */
public interface ShipperOrderDomainService {
    /**
     * 取消订单并下架货源
     *
     * @param orderId 订单id
     * @return 取消成功与否
     */
    Result<Boolean> cancelOrderWithPullOffCargo(Long orderId, Long shipperId, Integer orderCancelReason, String orderCancelDescription) throws Exception;


    /**
     * 取消订单但不下架货源
     *
     * @param orderId 订单id
     * @return 取消并下架成功与否
     */
    Result<Boolean> cancelOrderWithoutPullOffCargo(Long orderId, Long shipperId, Integer orderCancelReason, String orderCancelDescription) throws Exception;

    /**
     * 确认订单
     *
     * @param orderId 订单id
     * @return 确认成功与否
     */
    Result<Boolean> confirmReceipt(Long orderId, Long shipperId) throws Exception;

    /**
     * 查看订单详细信息
     *
     * @param orderId 订单id
     * @return 订单详细信息
     */
    Result<ShipperOrderDetailResponse> getOrderDetailByOrderId(Long orderId);

    /**
     * 查看进行中的订单
     *
     * @param shipperId 货主id
     * @return 进行中的货源列表
     */
    Result<List<ShipperOrderBriefResponse>> listOngoingOrdersByShipperId(Long shipperId);

    /**
     * 查看已完成的货源
     *
     * @param shipperId 货主id
     * @return 已完成的货源列表
     */
    Result<List<ShipperOrderBriefResponse>> listCompletedOrdersByShipperId(Long shipperId);

    /**
     * 查看已取消的货源
     *
     * @param shipperId 货主id
     * @return 已取消的货源列表
     */
    Result<List<ShipperOrderBriefResponse>> listCancelledOrdersByShipperId(Long shipperId);

    /**
     * 获取订单的司机的联系方式
     *
     * @param orderId 订单id
     * @return 司机手机号
     */
    Result<String> getDriverPhoneNumber(Long orderId);
}
